import { ConfigProvider } from "antd";
import { useThemeConf } from "./stores/themeConf";
import useThemeWatch from "./hooks/useThemeWatch";
import {router} from './routes'
import { RouterProvider } from 'react-router-dom'
import {getGlobalAntDActionContext} from "@/hooks/useAssignGlobalProps"
import zhCN from 'antd/locale/zh_CN';
function App() {
  useThemeWatch();
  const { algorithm } = useThemeConf();

  const antDGlobalContextHolder = getGlobalAntDActionContext()
  return (
    <ConfigProvider
      theme={{
        algorithm,
        token: {
          // Seed Token，影响范围大
          // colorPrimary: 'red',
        },
      }}
      locale={zhCN}
    >
      <RouterProvider router={router}></RouterProvider>
      {antDGlobalContextHolder}
    </ConfigProvider>
  );
}

export default App;
